﻿// <copyright file="About.aspx.cs" company="company"> 
// (C) 2010 . All rights reserved
// </copyright>
// <author>Lukasz Bartczak</author>

namespace LoginUserCheckPayment
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using LoginUserCheckPayment.ClientUserWcfService;

    /// <summary>
    /// Strona z płatnościami dzieci opiekuna, widziana po zalogowaniu
    /// </summary>
    public partial class About : System.Web.UI.Page
    {
        /// <summary>
        /// Service proxy.
        /// </summary>
        private Service1Client client = new Service1Client();

        /// <summary>
        /// Handles the Load event of the Page control, pobiera dane ze strony logowania i wykorzystuje je do pobrania płatności.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            _Default pgSource;
            pgSource = (_Default)Context.Handler;
            string[] opiekun = pgSource.loginName.Split(' ');
            this.GridView1.DataSource = this.client.GetPeymentsByOpiekun(opiekun[0], opiekun[1]);
            this.GridView1.DataBind();
        }
    }
}
